package de.mnit.basis.daten;


/**
 * @author Michael Nitsche
 */
public class MN {

	public static boolean oder(Object das, Object... gleich) {
		for(Object o : gleich)
			if(das.equals(o))
				return true;
		return false;
	}

	public static Object[]  o(Object... o)    { return o; }
	public static String[]  s(String... s)    { return s; }
	public static Integer[] i(Integer... i)   { return i; }
//	public static char[]   c(char... c)     { return c; }

	public static boolean istGefuellt(String test) {
		return test!=null && test.length()>0;
	}

	public static <T> T[]  t(T... t) {
		return t;
	}

	public static <T> T beiNull(T objekt, T bei_null) {
		return objekt==null ? bei_null : objekt;
	}

	public static boolean istTrue(Boolean b) {
		return b!=null && b;
	}

	public static boolean istNull(Object... oa) {
		for(Object o : oa)
			if(o != null)
				return false;
		return true;
	}

	public static boolean istGleich(Object o1, Object o2) {
		if(o1==null && o2==null)
			return true;
		if(o1==null || o2==null)
			return false;
		return o1.equals(o2);
	}

}
